Bathymetry Discretization and Routing Optimization Using Mathematica

Doug Denniston

Transient multiphase fluid dynamics

Transient multiphase fluid dynamic modeling forms the basis of MSi Kenny’s simulation technology.

Virtual Metering

Restriction detection / prevention

Forecasting

Computational speed is critical to the value of MSi Kenny’s simulation technology, because its systems are used to inform operational decision making in real time.

The Trouble with Flowline Discretization

In order to achieve calculation speeds required for our forecasting products, we must discretize flowlines into a sufficiently small number of sections of equal length which match the properties of the undiscretized profile.

Further, because processing time increases in excess of a rate proportional to the square of the number of simulated profile sections, an optimal discretization would include the smallest number of sections possible to maintain an acceptible level of fidelity to the relevant properties of the real pipeline.

Due to interfacial friction, gas flowing above liquid in a multiphase flowline drags the fluid uphill. The collection of liquid in the pipeline is referred to as holdup.

Holdups calculated for a discretized profile should match the holdups in the undiscretized profile.

This can be challenging because holdups are not typically known at configuration time. Enter the Angle Class Distribution - predicated on the idea that by preserving the distribution of angles in the original profile, the discretized profile can be made to accurately match holdups.

Can sometimes perform poorly with distributions with high variability in angle - in very long bathymetries or mountainous bathymetries.

Depending on the distribution of angles, preserving angle distribution may not necessarily be a demonstrably good proxy for holdup. May match cumulative holdup with swinging errors in holdup along the profile which cancel each other out, resulting in an inaccurate fluid collection profile

Multiphase Fluid Dynamic Modeling

A fortran dynamic library includes a collection of solvers capable of calculating fluid properties using a streamlined version of PIMS - MSi Kenny’s Pipeline Integrity Management System, the primary fluid dynamics engine used for all MSi Kenny models. Includes a rigorous inverse solver which can accurately calculate the holdup of a pipe section a priori.

Using the NETLink` capabilities within Mathematica, the inverse solver can be called from the GenTHFSlim Fortran DLL to calculate holdups during configuration rather than afterward.

Improvements to the Angle Class Distribution in This Work

Calculation of holdup at configuration time - allows for more meaningful evaluation of discretization performance

Leveraging of Mathematica’s built-in statistical functionality to apply classical distributions to angle class, in addtion to only the standard weighted-average distribution, and comparisons of various distributions’ performances in holdup and geometry matching

Inclusion of quantitiative geometrical fit metrics to assist with scoring

Iteration of the angle class routing method using an increasing number of sections in the distribution to study holdup and geometry fit sensitivity to number of sections

Going Deeper - Deviating from Angle Class to Optimize Routing

The use of angle class distributions is subject to its limitations in general, and even the most fitting distribution with the best number of sections will not always be a perfect match of holdup and certainly not a perfect geometrical match

Using Mathematica’s built in continuous optimization and interpolation techniques, huge candidate solution spaces can be searched for improvements to the discretized profile using methods such as Nelder-Mead, Differential Evolution, and Simulated Annealing

With these methods, the angle of each section in the discretized profile can be adjusted until that section’s holdup matches the averaged holdup of its constituent sections in the base profile while still preserving the endpoint elevations

(RowWithSeparators[	, "\t", , ])

(RowDefault["\t" , "\t" ])

Putting It All Together

Using Mathematica’s GUIKit and Enterprise CDF functionality, everything discussed here is available to our engineers as a .CDF file, which is deployable to all of our international offices, even those without Mathematica

All functionality is availble via an intuitive user interface which makes it easy to load and analyze base bathymetry